accessibility
Macromedia Logo Upper Navigation Bar
  Help
Lower Navigation Bar
ProductsSupportDesigner DeveloperDownloadsStoreInternationalSite MapCompany
Home > Products > Dreamweaver > Support > TechNote Index
Macromedia Dreamweaver Support Center - TechNote

Inserting a Windows Media Player in a Web page

Product: Dreamweaver
Platform: Win
Versions: 3.0 to 4.01
ID: 15777
How useful was this document?
less more

1

2

3

4

5

How can the document be improved? (300 characters or less - you will not receive a reply.)

Users often express interest in playing video files on their Web pages. This TechNote shows two options for embedding the Microsoft Windows Media Player in an HTML page to play a video file. Both options are designed for displaying the video files on Windows. The embedded Windows Media Player will display most video file formats in recent versions of both Microsoft Internet Explorer and Netscape, although whether the video files display as expected will depend on several factors, including specific configurations on the computers viewing the video files.

You should be comfortable with with hand-modifying source code (and this may involve changing certain parameters) before implementing these steps. The two options discussed in this TechNote are:

>

The VideoEmbed extension
Downloading the VideoEmbed extension from the Macromedia Dreamweaver Exchange. To find this extension, enter VideoEmbed in the Exchange's search box. This extension will add an object to the Objects panel which you can use to easily embed the Windows Media Player to play a video file. Even if you download and use this object to embed the Windows Media Player, you may still want to review the steps below for information about changing some of the object's parameters in the source code.

Note: This extension will add the following "type" parameter into the <embed> tag:

video/x-msvideo

If you find that Netscape is not "seeing" your embedded Windows Media Player, you might want to try changing this "type" parameter to:

application/x-mplayer2

You may still have to advise your Netscape users to refresh the page before the Media Player Plugin will display properly.

> Adding your own ActiveX parameters in Dreamweaver
1 In the Document window, place the insertion point where you want the Windows Media Player to appear.
2

Click the Insert ActiveX icon on the Special category of the Objects panel.

3

Select the ActiveX object in the Document window.

4

On the Property inspector, enter the following text into the Class ID text box:

CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95

You can copy the above text from this Web page and then paste it into the Class ID text box.

5

Also on the Property inspector, do the following:

a Select Embed.
b

Set the width and height in the W and H text boxes. A standard setting is 320 x 290 pixels.

c

Click the Browse folder icon (next to the Src text box) and navigate to find and select a file in a supported Media Player format. (Supported formats are listed in the chart below.)

d Type mediaplayer1 in the ID text box.
6 Click Parameters on the Property inspector.
7

In the Parameters dialog box, enter the following parameters:

Parameter
Value
FileName YourFileNameHere (same as the Src path in Step 5c)
AutoStart True
ShowControls True
ShowStatusBar False
ShowDisplay False
AutoRewind True

You add a parameter by clicking Plus (+). The above parameters are those most commonly chosen. You may want to change these to suit your needs. For instance, if you would prefer that the video not play until the viewer clicks Play, set the AutoStart parameter to False instead of True.

8

Switch to Code view or open the Code Inspector. Your HTML code will now look similar to that displayed below:

 
<object width="320" height="290" 
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 
id="mediaplayer1">
<param name="Filename" value="kids.mpg">
<param name="AutoStart" value="True">
<param name="ShowControls" value="True">
<param name="ShowStatusBar" value="False">
<param name="ShowDisplay" value="False">
<param name="AutoRewind" value="True">
<embed width="320" height="290" src="kids.mpg"
filename="kids.mpg" autostart="True" 
showcontrols="True" showstatusbar="False" 
showdisplay="False" autorewind="True">
</embed> 
</object>
9

In the source code add the following text inside the <embed> tag:

 
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
 
10 Your source code should now appear similar to:
 
<object width="320" height="290" 
classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 
id="mediaplayer1">
<param name="Filename" value="kids.mpg">
<param name="AutoStart" value="True">
<param name="ShowControls" value="True">
<param name="ShowStatusBar" value="False">
<param name="ShowDisplay" value="False">
<param name="AutoRewind" value="True">
<embed 
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
width="320" height="290" src="kids.mpg"
filename="kids.mpg" autostart="True" 
showcontrols="True" showstatusbar="False" 
showdisplay="False" autorewind="True">
</embed> 
</object>
 
10 Save the file and test on different systems and in different browsers.

See Example 1 for a demonstration of an embedded Windows Media Player playing a MPG video file. This file will play best in Internet Explorer; Netscape users may experience unpredictable results. In particular, Netscape must have the Windows Media Play plug-in (Npdsplay.dll) for the file to play.

Media formats supported by Windows Media Player
   
Supported Media Formats

Windows

Microsoft Windows Media formats

 

.avi, .asf, .asx, .rmi, .wav, .wma, .wax

Moving Pictures Experts Group (MPEG)

 

.mpg, .mpeg, .m1v, .mp2, .mp3, .mpa, .mpe

Musical Instrument Digital Interface (MIDI)  
.mid, .rmi
Apple QuickTime®, Macintosh® AIFF Resource  
.qt, .aif, .aifc, .aiff, .mov
UNIX formats  
.au, .snd

Supported Browsers
   
Supported browsers

Windows

Internet Explorer 4.x

Internet Explorer 5.x

Netscape 4.x

Nescape 6

Note: Again, how different video files will play in an embedded Windows Media Player can be unpredictable in different browsers and on different systems. You will want to test your pages on different systems to be sure you are getting the consistent results that you anticipate. Some file formats, such as some AVI files, may display on both Windows and Macintosh (QuickTime will probably display the video files on the Macintosh). Some AVI files, however, may play in QuickTime on both platforms but not in Windows Media Player.

Additional information
You'll find more information about embedding and troubleshooting the Windows Media Player in these Microsoft resources below:

  Placing the Windows Media Player Control in a Web Page
  Error Message: Unable to Download an Appropriate Decompressor (Q230687)
 

Windows Media Player Error Code Page

  Error 80040200 Unable to Download Appropriate Decompressor.
  Windows Media Player Invalid File Format Error Message (Q234019)
  Windows Media Player 7, 7.1 Multimedia File Formats
  Windows Media Player Version 7 Frequently Asked Questions
  Windows Media Player Version 6.4 Frequently Asked Questions


Last updated: December 28, 2001
Keywords: Windows Media Player, embed, mpg, mpeg, mp3, .avi, .asf, .asx, .rmi, .wav, .wma, .wax, .mpg, .mpeg, .m1v, .mp2, .mp3, .mpa, .mpe, .mid, .rmi, .qt, .aif, .aifc, .aiff, .mov, .au
Created: August 20, 2001
©1995-2002 Macromedia, Inc. All rights reserved.
Accessibility | Privacy policy | Contact us | Site Map